package com.lksoft.bz.action;

import java.awt.event.ActionEvent;
import java.io.IOException;

import javax.swing.AbstractAction;

import com.lksoft.bz.Bz;
import com.lksoft.bz.PrintPreview;
import com.lksoft.bz.StitchPrinter;

public class PrintPreviewAction extends AbstractAction{
	private static final long serialVersionUID = -59202549515211165L;
	
	private Bz bz;
	
	/**
	 * @param bz The program
	 * @throws IOException 
	 */
	public PrintPreviewAction(Bz bz) throws IOException{
		this.bz = bz;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		PrintPreview preview = new PrintPreview(new StitchPrinter(bz.getStitchPanel(), bz.getUsedBeads()), bz.getPageFormat());
		preview.show();
	}
}
